package com.skyblue.relation.action;

import java.util.Iterator;
import java.util.List;


import com.opensymphony.xwork2.ActionSupport;
import com.skyblue.relation.domain.Department;
import com.skyblue.relation.service.DepartmentService;

public class ListAllDepartment extends ActionSupport{
	private DepartmentService departmentService;
	public List<Department> departs;
	public DepartmentService getDepartmentService() {
		return departmentService;
	}
	public void setDepartmentService(DepartmentService departmentService) {
		this.departmentService = departmentService;
	}
	public List<Department> getDeparts() {
		return departs;
	}
	public void setDeparts(List<Department> departs) {
		this.departs = departs;
	}
	public String execute()  {
		departs = departmentService.listAllDepartment();
		for(Iterator<Department> i = departs.iterator(); i.hasNext();){
			Department dept = i.next();
		}
		return SUCCESS;
	}
}
